﻿/*Copyright (C) 2010-2012 RAAFCOM B.V. All rights reserved.

This file is part of Velsto and may be used under the terms of:
The GNU General Public License version 3 or higher, as published by
the Free Software Foundation.

This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.*/
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;

namespace Velsto
{
    public class HistInterval : IComparable
    {
        double x_from = 0.0;
        double x_till = 0.0;
        int    y    = 0;
       
        public HistInterval()
        {
            
        }

        public HistInterval(double xf, double xt, int y1)
        {
            this.X_from = xf;
            this.X_till = xt;
            this.Y = y1;
        }


        public double X_from
        {
            get { return x_from; }
            set { x_from = value; }
        }
        
        public double X_till
        {
            get { return x_till; }
            set { x_till = value; }
        }
        
        public int Y
        {
            get { return y; }
            set { y = value; }
        }

        public int CompareTo(Object obj)
        {
            HistInterval xy2 = obj as HistInterval;
            if (this.X_from > xy2.X_from)
            {
                return 1;
            }
            else if (this.X_from < xy2.X_from)
            {
                return -1;
            }
            else if (this.X_till > xy2.X_till)
            {
                return 1;
            }
            else if (this.X_till < xy2.X_till)
            {
                return -1;
            }
            else
            {
                return 0;
            }
            
        }

    }
}
